#ifndef J3DGRAPH_BMD_MAT3_HEADER
#define J3DGRAPH_BMD_MAT3_HEADER

// this header needs
#include <stdio.h>
#include "../../J3DGRAPH.h"

// BMD MAT3 section constants
#define J3DGRAPH_BMD_MAT3_POS 6

// j3dgraph_bmd_mat3_err_cd enum
// enum with the possible codes a MAT3 section will present while analizing it
// errors codes are organized so fatal errors have less magnitude than the soft errors
typedef enum
{
  J3DGRAPH_BMD_MAT3_ERR_INV_STRUCT, // j3dgraph struct ptr is NULL/empty
  J3DGRAPH_BMD_MAT3_ERR_HEADER,     // section header is inconsistent
  
  J3DGRAPH_BMD_MAT3_ERR_NO_ERR,     // errors below this (in value) are fatal, above or equal are safe
  
  // ...
} j3dgraph_bmd_mat3_err_cd;

// need to investigate more about this section
typedef struct
{
  // my additions
  char * PATH;                      // file path
  ENDIAN_T ENDIAN;                  // endian
  j3dgraph_bmd_mat3_err_cd ERR_CD;  // error code
  // actual structure
  byte * START;                     // 00 char[4]
  byte * SIZE;                      // 01 uint32
  byte * MAT_CNT;                   // 02 uint16
  //... skip 10 bytes
  byte * MAT_STR_TB_OFFSET;         // 03 uint32
  //... skip until MAT_NAME_TABLE
  j3dgraph_str_tb * MAT_STR_TB;     // 04 ??
  //...
} j3dgraph_bmd_mat3;

// functions to check the information on the BMD MAT3 section
j3dgraph_bmd_mat3_err_cd check_j3dgraph_bmd_mat3(j3dgraph * file);

// append/remove/print the j3dgraph_bmd_mat3
// structure to an incomplete j3dgraph structure
j3dgraph_bmd_mat3 * append_j3dgraph_bmd_mat3(j3dgraph * file);
void remove_j3dgraph_bmd_mat3(j3dgraph * file);
void print_j3dgraph_bmd_mat3(j3dgraph_bmd_mat3 * mat3);

#include "MAT3.c"

#endif // J3DGRAPH_BMD_MAT3_HEADER
